class PlayerObserver < ActiveRecord::Observer
  def after_create(player)
    PlayerNotifier.deliver_signup_notification(player)
  end

  def after_save(player)
    PlayerNotifier.deliver_activation(player) if player.recently_activated?
    PlayerNotifier.deliver_forgot_password(player) if player.recently_forgot_password?
    PlayerNotifier.deliver_reset_password(player) if player.recently_reset_password?
  end
end